<div class="album">
    <?php $id = count($albums) > 3 ? ' id="album_list"' : '';?>
    <ul<?php echo $id;?>>
        <?php 
            foreach($albums as $album):
                $uri = '/thu-vien-anh/'. url_title($album->name, "dash", TRUE) . '-' . $album->id;
        ?>
        <li class="hp_album">
            <a href="<?php echo $uri;?>"><img src="/images/albums/<?php echo $album->image_name;?>" alt="<?php echo $album->name;?>" /></a>
        </li>
        <?php endforeach;?>
    </ul>
</div>